package com.thingsgrid.workorder.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.thingsgrid.workorder.entity.ProcessWorkOrder;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;

import java.util.List;

/**
 * 服务类
 *
 * @author MQ
 */
public interface IWorkOrderService extends BaseService<ProcessWorkOrder> {

	/**
	 * 开启工单流程
	 *
	 * @param processWorkOrder
	 * @return boolean
	 */
	boolean startProcess(ProcessWorkOrder processWorkOrder);

	/**
	 * 分配工单
	 * @param processWorkOrders
	 * @param targetId
	 * @return
	 */
	boolean disProcess(List<ProcessWorkOrder> processWorkOrders, String targetId);
	/**
	 * 处理工单
	 * @param processWorkOrders
	 * @return
	 */
	boolean handProcess(List<ProcessWorkOrder> processWorkOrders);
	/**
	 * 关闭工单
	 * @param processWorkOrders
	 * @return
	 */
	boolean closeProcess(List<ProcessWorkOrder> processWorkOrders);
	/**
	 * 获取单个工单内容
	 * @param odrId
	 * @return
	 */
	ProcessWorkOrder getOneWorkOrder(long odrId);
	/**
	 * 获取工单列表分页
	 * @param query
	 * @param processWorkOrder
	 * @return
	 */
	IPage<ProcessWorkOrder> getListProcessWorkOrders(Query query, ProcessWorkOrder processWorkOrder);
}
